/*
 * @Author: sunkai@xinxinapp.cn
 * @Date: 2020-06-11 13:06:16
 * @LastEditTime: 2020-12-20 15:08:59
 * @LastEditors: sunkai@xinxinapp.cn
 * @Description: 
 * @FilePath: /fed-e-task-02-02/webpack.prod.js
 */

const common = require('./webpack.common')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const { merge } = require('webpack-merge')
const OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin')
const TerserWebpackPlugin = require('terser-webpack-plugin')

module.exports = merge(common, {
  mode: 'production',
  optimization: {
    minimizer: [
      new OptimizeCssAssetsWebpackPlugin(),
      new TerserWebpackPlugin()
    ] 
  },
  plugins: [
    new CleanWebpackPlugin(),
  ]
})